/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : 
  * @brief          : 
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __CAN_DEVICE_H
#define __CAN_DEVICE_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stdint.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Private defines -----------------------------------------------------------*/
#define CANIO_BUFSIZE	30
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
typedef struct 
{
	 uint16_t  ID;
	 uint8_t   data[64];
	 uint32_t  dlc;
}CanBufT;
typedef struct 
{
	uint16_t TxSendPtr;
	uint16_t TxSentPtr;
	uint16_t RxRecvPtr;
	uint16_t RxPrcsPtr;
	
	CanBufT  RxData[CANIO_BUFSIZE];
	CanBufT  TxData[CANIO_BUFSIZE];
}_CANIO;
extern _CANIO CanIO;
/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
/* USER CODE BEGIN EFP */
void CANDevice_Receive(void);
void CANDevice_Transmit(void);
void CANDevice_Config(uint8_t ID);
void CANDevice_DoneRxPrcs(void);
void CANDevice_TriggerTxSend(void);
void CANDevice_Communication(void);
void CANDevice_Init(void);
void CANIO_UpdateID(void);
void CANIO_Baud_rate_switching(uint8_t set_rate);
/* USER CODE END EFP */
#ifdef __cplusplus
}
#endif

#endif 
